import { ApiProperty } from "@nestjs/swagger";
import {
  IsNumber,
  IsOptional,
  IsString,
  Max,
  Min,
  MinLength,
} from "class-validator";

export class UpdateClientDto {
  @IsString()
  @IsOptional()
  @ApiProperty({
    required: false,
    description: "客户名称",
  })
  @MinLength(1)
  name?: string;

  @IsString()
  @IsOptional()
  @ApiProperty({
    required: false,
    description: "简称",
  })
  short?: string;

  @IsString()
  @IsOptional()
  @ApiProperty({
    required: false,
    description: "地址",
  })
  address?: string;

  @IsString()
  @IsOptional()
  @ApiProperty({
    required: false,
    description: "联系方式",
  })
  contact?: string;

  @IsNumber()
  @IsOptional()
  @Min(0)
  @Max(28)
  @ApiProperty({
    required: false,
    description: "月结时间",
  })
  summary?: number;
}
